//
//  UPOrderViewController.m
//  LoveFreshBee
//
//  Created by wyzc on 16/6/8.
//  Copyright © 2016年 叶落知秋. All rights reserved.
//

#import "UPOrderViewController.h"

@interface UPOrderViewController ()

@end

@implementation UPOrderViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //设置背景颜色
    self.view.backgroundColor=[UIColor redColor];
    //设置导航条颜色
    self.navigationController.navigationBar.barTintColor=UPColor(255, 218, 0);
    
    [self setNavBar];
    [self setSearch];
}
//添加扫描按钮
-(void)setNavBar
{
    UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 30)];
    
    [btn addTarget:self action:@selector(btnLeftClick) forControlEvents:UIControlEventTouchUpInside];
    
    [btn setBackgroundImage:[UIImage imageNamed:@"icon_black_scancode"]forState:UIControlStateNormal];
    
    UIBarButtonItem *leftItem=[[UIBarButtonItem alloc]initWithCustomView:btn];
    
    self.navigationItem.leftBarButtonItem=leftItem;
}
//添加搜索按钮
-(void)setSearch
{
    UIButton *btn=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 30, 30)];
    
    [btn addTarget:self action:@selector(btnRightSearch) forControlEvents:UIControlEventTouchUpInside];
    
    [btn setBackgroundImage:[UIImage imageNamed:@"icon_search"] forState:UIControlStateNormal];
    UIBarButtonItem *rightItem=[[UIBarButtonItem alloc]initWithCustomView:btn];
    self.navigationItem.rightBarButtonItem=rightItem;
}

//点击按钮，调用方法
-(void)btnLeftClick
{
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
//点击放大镜，调用方法
-(void)btnRightSearch
{
    
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
